﻿<UserControl
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:nav="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
             x:Class="SilverlightOverview.MainPage"
             xmlns:data="clr-namespace:SilverlightOverview.Data;assembly=SilverlightOverview"
             xmlns:Windows="clr-namespace:System.Windows;assembly=System.Windows.Controls"
             mc:Ignorable="d" d:DesignWidth="383" d:DesignHeight="291">
    <UserControl.Resources>
        
        <data:ExampleFactory x:Key="ExampleData" />

        <Windows:HierarchicalDataTemplate x:Key="NodeTemplate" ItemsSource="{Binding Examples}">
            <controls:Label Content="{Binding Text}" FontSize="12" />
        </Windows:HierarchicalDataTemplate>

    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" Background="White" DataContext="{StaticResource ExampleData}">
        <Grid.ColumnDefinitions>
    		<ColumnDefinition Width="0.18*"/>
    		<ColumnDefinition Width="0.82*"/>
    	</Grid.ColumnDefinitions>
        
        <controls:TreeView HorizontalAlignment="Stretch" 
                           ItemsSource="{Binding Examples}"
                           ItemTemplate="{StaticResource NodeTemplate}"
                           SelectedItemChanged="TreeView_SelectedItemChanged" />
        
        <nav:Frame x:Name="MainFrame" Source="Examples/BasicElements"
                   HorizontalContentAlignment="Stretch"
                   VerticalContentAlignment="Stretch"
                   Margin="8,8,8,12" Grid.Column="1" Grid.ColumnSpan="1" />

        <controls:GridSplitter Name="splitter" Grid.Column="1" ShowsPreview="True" Width="8"
                               HorizontalAlignment="Left" VerticalAlignment="Stretch" Canvas.ZIndex="1"
                               Visibility="Visible"
                               />
    </Grid>
</UserControl>
